﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using OTA.Notification.BO.Message;
using OTA.Notification.Entity.Model.Message;

namespace OTA.Notification.Web.Message
{
    public partial class RepeatMsg : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["id"] != null)
                {
                    int iID = 0;
                    int.TryParse(Request.QueryString["id"], out iID);


                    InitPage();

                    BindData(iID);

                }
            }
        }

        private void InitPage()
        {

        }

        private void BindData(int ID)
        {
            using (RepeatMessageBO bo = new RepeatMessageBO())
            {
                RepeatMsgBean bean = bo.Load(ID);

                if (bean != null)
                {
                    lblAppName.Text = bean.AppCode;
                    lblApp.Text = bean.OrgCode;

                    lblClientSeq.Text = bean.ClientTXSeq;

                    lblCombo.Text = bean.Group.ToString();

                    lblEndTime.Text = bean.RepeatEndTime.ToString();

                    lblInterval.Text = bean.RepeatInterval.ToString();

                    lblMsgSendType.Text = bean.MsgSendType;

                    lblMsgTemplate.Text = bean.MsgTemplate;
                    lblMsgType.Text = bean.MsgType;

                    lblNextStartTime.Text = bean.NextStartTime.ToString();

                    lblPassedTimes.Text = bean.PassedRepeatTimes.ToString();

                    lblPriority.Text = bean.Priority.ToString();

                    lblReceiverAccount.Text = bean.ReceiverAccount;

                    lblReceiverAccountType.Text = bean.ReceiverAccountType;

                    lblRepeatTimes.Text = bean.RepeatTimes.ToString();

                    lblSender.Text = bean.Sender;

                    lblStartTime.Text = bean.RepeatStartTime.ToString();

                }
            }
        }


        protected void btnCancel_Click(object sender, EventArgs e)
        {
            Response.Write("<script>window.parent.Close()</script>");
        }
    }
}
